package main

import (
	"fmt"
	"time"
)

func main() {

	ticker := time.NewTicker(time.Second)
	n := 0
	for i := range ticker.C {
		fmt.Println(i)

		n++

		if n > 5 {
			ticker.Stop()
			return
		}
	}
}
